import { useToast } from 'vue-toastification';
import { POSITION } from 'vue-toastification/src/ts/constants';

// 封装通用通知函数
export const showNotification = (msg: string, isError: boolean = false) => {
  const toast = useToast();
  const options = {
    timeout: 3000,
    position: POSITION.BOTTOM_RIGHT,
  };

  if (isError) {
    toast.error(msg, options);
  } else {
    toast.info(msg, options);
  }
};